<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSwtArticleTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('swt_article', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('title')->default('')->comment('标题');
            $table->string('image')->nullable()->comment('封面图');
            $table->text('content')->comment('内容');
            $table->tinyInteger('sort')->default('0')->comment('排序');
            $table->string('source')->nullable()->comment('来源');
            $table->tinyInteger('status')->default('1')->comment('状态 0隐藏 1显示');
            $table->timestamp('show_time')->nullable()->comment('发布时间');
            $table->enum('type')->comment('文章类型');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('swt_article');
    }
}
